package demo3;

public class Test {
    public static void eat(Animal animal) {
        animal.eat();
    }
    public static void fly(IFly ifly) {
        ifly.fly();
    }
    public static void swim(ISwim iswim) {
        iswim.swim();
    }
    public static void run(IRun irun) {
        irun.run();
    }
    public static void main(String[] args) {
        eat(new Dog("旺财"));
        eat(new Bird("布谷"));
        eat(new Duck("小丑鸭"));
        System.out.println("-----------");
        fly(new Bird("布谷"));
        fly(new Duck("小丑鸭"));
    }
}
